﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace FasterWPF
{
    public static class FontExt
    {
       // public static void ApplyUnderlineToLabel(Label lbl)
      //  {
            //create a class to enumerate the children of Label and set text decorations on the interal textblock to underline / / /
            //.EnumerateChildren<TextBlock>(lbl, true).ForEach(c => c.TextDecorations = TextDecorations.Underline);
      //  }

        public static FontSettings CreateFont(string fontFamily,
double fontSize, FontWeight fontWeight, FontStyle fontStyle)
        {
            FontSettings f = new FontSettings();
            f.FontFamily = fontFamily;
            f.FontSize = fontSize;
            f.FontWeight = fontWeight;
            f.FontStyle = fontStyle;

            return f;
        }

        public static void ApplyFontSettings(FontSettings storedFont,
FontFamily f, TextBlock linelabel)
        {
            linelabel.FontFamily = f;
            linelabel.FontWeight = storedFont.FontWeight;
            linelabel.FontSize = storedFont.FontSize;
            linelabel.FontStyle = storedFont.FontStyle;
        }
        
        public static void ApplyFontSettings(FontSettings storedFont,
FontFamily f, Label linelabel)
        {
            linelabel.FontFamily = f;
            linelabel.FontWeight = storedFont.FontWeight;
            linelabel.FontSize = storedFont.FontSize;
            linelabel.FontStyle = storedFont.FontStyle;
        }

        public static void ApplyFontSettings(FontSettings storedFont, TextBlock linelabel)
        {
            linelabel.FontFamily = new FontFamily(storedFont.FontFamily);
            linelabel.FontWeight = storedFont.FontWeight;
            linelabel.FontSize = storedFont.FontSize;
            linelabel.FontStyle = storedFont.FontStyle;
        }

        public static void ApplyFontSettings(FontSettings storedFont, Label linelabel)
        {
            linelabel.FontFamily = new FontFamily(storedFont.FontFamily);
            linelabel.FontWeight = storedFont.FontWeight;
            linelabel.FontSize = storedFont.FontSize;
            linelabel.FontStyle = storedFont.FontStyle;
        }
    }
}
